package com.bes.opslink.aiops.server.api.client.demo;

import com.bes.opslink.aiops.commons.dto.base.R;
import com.bes.opslink.aiops.server.api.commons.ServerApiConstants;
import com.bes.opslink.aiops.server.api.dto.DemoDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * demo feign接口
 */
@FeignClient(value = ServerApiConstants.SERVER_FEIGN_VALUE, path = ServerApiConstants.SERVER_FEIGN_PATH + "/demo", contextId = "DemoClient")
public interface DemoClient {

    /**
     * 根据ID查询实体信息
     *
     * @param id ID
     * @return 实体信息
     */
    @GetMapping("/{id}")
    R<DemoDTO> queryById(@PathVariable("id") Long id);

    /**
     * 保存实体信息
     *
     * @param demoDTO 实体信息
     * @return true-保存成功; false-保存失败
     */
    @PostMapping
    R<Boolean> save(@RequestBody DemoDTO demoDTO);
}
